package net.begincode.biz.impl;

import net.begincode.biz.HomeTypeBiz;
import net.begincode.blog.entity.HomeType;
import net.begincode.blog.service.HomeTypeService;
import net.begincode.json.JsonUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class HomeTypeBizImpl implements HomeTypeBiz{
    private final Logger LOGGER = LoggerFactory.getLogger(HomeTypeBizImpl.class);

    @Resource
    private HomeTypeService homeTypeService;
    @Override
    public int addHomeType(HomeType homeType) {
        if(LOGGER.isDebugEnabled()){
            LOGGER.info(JsonUtil.toJson(homeType));
        }
        return homeTypeService.addHomeType(homeType);
    }

    @Override
    public int updateHomeTypeById(HomeType homeType) {
        return homeTypeService.updateHomeTypeById(homeType);
    }

    @Override
    public HomeType queryById(Long homeTypeId) {
        return homeTypeService.selectById(homeTypeId);
    }
}
